package com.example.easypoi.entity;

import lombok.Data;
import org.jeecgframework.poi.excel.annotation.*;

import java.util.List;

@Data
@ExcelTarget("user") // 指定导出目标
public class User {

    @Excel(name = "用户ID", width = 15,needMerge = true)
    private Long id;

    @Excel(name = "姓名", width = 20,needMerge = true)
    private String name;

    @Excel(name = "手机号", width = 15,needMerge = true)
    @ExcelVerify(isMobile = true) // 手机号校验
    private String phone;

    @Excel(name = "邮箱", width = 25,needMerge = true)
    @ExcelVerify(isEmail = true) // 邮箱校验
    private String email;

    @Excel(name = "头像", type = 2, width = 20, imageType = 1, savePath = "upload/avatar",needMerge = true)
    private String avatarPath; // 图片字段

    @ExcelEntity(name = "部门")
    private Department department;

    @ExcelCollection(name = "订单列表", orderNum = "5")
    private List<Order> orders;
}